import request from '@/utils/request'
import qs from "qs";

// 查询新闻中心列表
export function listNews(query) {
  return request({
    url: '/system/news/list',
    method: 'get',
    params: query
  })
}

// 查询新闻中心详细
export function getNews(id) {
  return request({
    url: "/system/news/" + id,
    method: "get",
  });
}

// 新增新闻中心
export function addNews(data) {
  return request({
    url: "/system/news",
    method: "post",
    // data:data
    data: qs.stringify(data),
    headers: {
      "content-type": "application/x-www-form-urlencoded",
    },
  });
}

// 修改新闻中心
export function updateNews(data) {
  return request({
    url: "/system/news",
    method: "put",
    data: qs.stringify(data),
    headers: {
      "content-type": "application/x-www-form-urlencoded",
    },
  });
}

// 删除新闻中心
export function delNews(id) {
  return request({
    url: "/system/news/" + id,
    method: "delete",
  });
}
